<template>
  <el-container class="stuInfoModifyMain">
    <el-descriptions border :column="4" direction="vertical" class="infoSheet">
      <template #title>
        <span class="stuInfo"><i class="el-icon-setting"></i>&nbsp;&nbsp;修改信息</span>
      </template>
      <template #extra>
        <el-badge :value="Mods > 0 ? Mods : ''" type="warning" class="InfoModBadge">
          <el-button :disabled="Mods === 0" type="primary" @click="setModify">保存修改</el-button>
        </el-badge>
        <el-button :disabled="Mods === 0" style="margin-left: 25px" @click="Discard()">放弃修改</el-button>
      </template>
      <el-descriptions-item>
        <template #label>
          <div class="titleCon">
            <svg t="1631868104090" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8028" width="20" height="20"><path d="M512.662999 1023.187002C232.152629 1023.819 0.07015 794.357516 0.01015 513.968146-0.04985 218.939808 238.898613 10.560276 490.949047 0.410299c283.551363-11.383974 532.227805 216.029515 532.618804 511.448851 0.361999 280.901369-230.123483 510.723853-510.904852 511.326852M240.103611 844.230404c14.364968-25.599943 28.851935-50.867886 42.825904-76.406829 32.224928-58.698868 82.490815-87.098804 148.657666-87.971802 49.331889-0.632999 98.723778 0.420999 148.055667-0.301999 72.099838-1.023998 125.949717 28.581936 160.734639 92.339792 13.46297 24.634945 28.279936 48.517891 42.585904 72.972836C895.299139 766.107579 984.325939 581.158995 927.796066 386.512432 875.362184 206.080837 699.599579 75.70413 509.229006 77.692125 318.046436 79.680121 147.583819 208.339832 95.932935 386.151433c-55.866875 192.296568 29.604934 376.944153 144.169676 458.078971" fill="#909399" p-id="8029"></path><path d="M519.107984 624.045898c-115.197741-1.355997-207.476534-95.350786-205.940537-209.765529 1.535997-111.794749 97.458781-203.742542 210.969526-202.145545 109.053755 1.505997 201.904547 96.072784 201.784547 205.518538-0.06 112.577747-95.349786 207.657534-206.813536 206.392536" fill="#909399" p-id="8030"></path></svg>
            &nbsp;<span>学生姓名</span>
          </div>
        </template>
        <span class="infoContent">{{stuInfo.sname}}</span>
      </el-descriptions-item>
      <el-descriptions-item label="性别">
        <template #label>
          <div class="titleCon">
            <svg t="1631867592339" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1800" width="20" height="20"><path d="M688.426667 335.573333a282.026667 282.026667 0 0 0-37.973334-72.32L704 209.706667V298.666667h85.333333V64H554.666667v85.333333h88.96l-53.546667 53.546667a277.333333 277.333333 0 1 0-254.506667 485.546667 282.026667 282.026667 0 0 0 37.973334 72.32L341.333333 792.96l-50.773333-50.773333-60.373333 60.373333L280.96 853.333333 234.666667 899.626667 295.04 960 341.333333 913.706667 387.626667 960 448 899.626667 401.706667 853.333333l32.213333-32.213333a277.333333 277.333333 0 1 0 254.506667-485.546667zM618.666667 426.666667a192 192 0 0 1-192 192c-6.826667 0-13.653333 0-20.266667-1.066667 0-6.613333-1.066667-13.44-1.066667-20.266667a192 192 0 0 1 192-192c6.826667 0 13.653333 0 20.266667 1.066667 1.066667 6.613333 1.066667 13.44 1.066667 20.266667z m-384 0a192 192 0 0 1 351.786666-106.666667A277.333333 277.333333 0 0 0 320 586.453333 192 192 0 0 1 234.666667 426.666667z m362.666666 362.666666a192 192 0 0 1-159.786666-85.333333A277.333333 277.333333 0 0 0 704 437.546667 192 192 0 0 1 597.333333 789.333333z" p-id="1801" fill="#909399"></path></svg>
            &nbsp;<span>性别</span>
          </div>
        </template>
        <el-select v-model="InfoTemp.sex" :popper-append-to-body="false" popper-class="mySelect" size="small">
          <el-option label="男" value="男"></el-option>
          <el-option label="女" value="女"></el-option>
        </el-select>
      </el-descriptions-item>
      <el-descriptions-item :span="2">
        <template #label>
          <div class="titleCon">
            <svg t="1631867888156" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7017" width="20" height="20"><path d="M885.4 202.9H139.7c-23.5 0-42.6 19.1-42.6 42.6v532.7c0 23.6 19.1 42.6 42.6 42.6h340.9c17.7 0 32-14.3 32-32s-14.3-32-32-32H161v-490h703.1v490.1H736.8c-17.7 0-32 14.3-32 32 0 17.6 14.3 32 32 32h148.6c23.5 0 42.6-19.1 42.6-42.6V245.5c0-23.5-19.1-42.6-42.6-42.6z" p-id="7018" fill="#909399"></path><path d="M224.9 330.7v213.1h191.8V330.7H224.9z m127.8 149.2h-63.9v-85.2h63.9v85.2zM480.6 330.7h319.6v63.9H480.6zM480.6 479.9h319.6v63.9H480.6zM224.9 629.1h575.3V693H224.9z" p-id="7019" fill="#909399"></path></svg>
            &nbsp;<span>学号</span>
          </div>
        </template>
        <span class="infoContent">{{account}}</span>
      </el-descriptions-item>
      <el-descriptions-item>
        <template #label>
          <div class="titleCon">
            <svg t="1631922923621" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2760" width="20" height="20"><path d="M246.092544 837.12V512c0-10.24 7.68-20.48 20.48-20.48 10.24 0 20.48-7.68 20.48-20.48v-5.12c0-10.24-7.68-20.48-20.48-20.48H102.732544c-10.24 0-20.48 7.68-20.48 20.48 0 10.24 7.68 20.48 20.48 20.48 10.24 0 20.48 7.68 20.48 20.48v327.68c0 10.24 7.68 20.48 20.48 20.48h84.48c10.24 2.56 17.92-7.68 17.92-17.92zM1006.412544 360.96c-17.92-12.8-327.68-235.52-448-322.56-28.16-20.48-66.56-20.48-92.16 0C345.932544 125.44 38.732544 348.16 18.252544 360.96c-23.04 15.36-25.6 38.4 0 48.64h988.16c23.04-12.8 23.04-33.28 0-48.64z m-481.28-46.08c-51.2 10.24-94.72-33.28-84.48-84.48 5.12-28.16 28.16-51.2 56.32-56.32 51.2-10.24 94.72 33.28 84.48 84.48-5.12 28.16-28.16 51.2-56.32 56.32zM18.252544 1024h985.6c10.24 0 17.92-7.68 17.92-17.92 0-10.24-7.68-17.92-17.92-17.92H18.252544c-10.24 0-17.92 7.68-17.92 17.92 0 10.24 7.68 17.92 17.92 17.92zM61.772544 936.96h901.12c10.24 0 17.92-7.68 17.92-17.92 0-10.24-7.68-17.92-17.92-17.92H61.772544c-10.24 0-17.92 7.68-17.92 17.92 0 10.24 7.68 17.92 17.92 17.92zM573.772544 837.12V509.44c0-10.24 7.68-20.48 20.48-20.48h2.56c10.24 0 20.48-7.68 20.48-20.48v-2.56c0-10.24-7.68-20.48-20.48-20.48h-166.4c-10.24 0-20.48 7.68-20.48 20.48 0 10.24 7.68 20.48 20.48 20.48h2.56c10.24 0 20.48 7.68 20.48 20.48v330.24c0 10.24 7.68 20.48 20.48 20.48h84.48c7.68 0 15.36-10.24 15.36-20.48zM901.452544 837.12V509.44c0-10.24 7.68-20.48 20.48-20.48 10.24 0 20.48-7.68 20.48-20.48v-2.56c0-10.24-7.68-20.48-20.48-20.48h-166.4c-10.24 0-20.48 7.68-20.48 20.48 0 10.24 7.68 20.48 20.48 20.48h2.56c10.24 0 20.48 7.68 20.48 20.48v330.24c0 10.24 7.68 20.48 20.48 20.48h84.48c7.68 0 17.92-10.24 17.92-20.48z" p-id="2761" fill="#909399"></path></svg>
            &nbsp;&nbsp;<span>所属学院</span>
          </div>
        </template>
        <span class="infoContent">{{stuInfo.dname}}</span>
      </el-descriptions-item>
      <el-descriptions-item>
        <template #label>
          <div class="titleCon">
            <svg t="1631922967590" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3692" width="20" height="20"><path d="M762.8 158.6h-64v297.3l-71.7-52.6-71.7 52.6V158.6H261.2c-42.3 0-76.8 34.5-76.8 76.8v553c0 42.3 34.5 76.8 76.8 76.8h501.7c42.3 0 76.8-34.5 76.8-76.8v-553c-0.1-42.3-34.7-76.8-76.9-76.8zM302.1 732.3c0 16.9-11.5 30.8-25.6 30.8-14.1 0-25.6-13.8-25.6-30.8V291.2c0-16.9 11.5-30.8 25.6-30.8 14.1 0 25.6 13.8 25.6 30.8v441.1z" p-id="3693" fill="#909399"></path></svg>
            &nbsp;&nbsp;<span>所修专业</span>
          </div>
        </template>
        <span class="infoContent">{{stuInfo.mname}}</span>
      </el-descriptions-item>
      <el-descriptions-item :span="2">
        <template #label>
          <div class="titleCon">
            <svg t="1631923075182" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4809" width="20" height="20"><path d="M841.955556 532.48c-54.613333-25.031111-159.288889-20.48-209.351112 0-11.377778 4.551111-22.755556 11.377778-31.857777 18.204444 79.644444 72.817778 131.982222 172.942222 141.084444 288.995556H987.591111c15.928889-2.275556 27.306667-15.928889 27.306667-36.408889-2.275556-122.88-72.817778-225.28-172.942222-270.791111z m-382.293334 6.826667c-65.991111-29.582222-191.146667-25.031111-250.311111 0-120.604444 52.337778-204.8 177.493333-204.8 323.128889 0 22.755556 15.928889 40.96 34.133333 43.235555H630.328889c18.204444-2.275556 34.133333-20.48 34.133333-43.235555-2.275556-145.635556-86.471111-270.791111-204.8-323.128889zM327.68 500.622222c111.502222 0 200.248889-88.746667 200.248889-200.248889s-88.746667-200.248889-200.248889-200.248889-200.248889 88.746667-200.248889 200.248889 91.022222 200.248889 200.248889 200.248889z m405.048889 0c93.297778 0 166.115556-75.093333 166.115555-166.115555s-75.093333-166.115556-166.115555-166.115556c-93.297778 0-166.115556 75.093333-166.115556 166.115556s72.817778 166.115556 166.115556 166.115555z m0 0" p-id="4810" fill="#909399"></path></svg>
            &nbsp;&nbsp;<span>所属班级</span>
          </div>
        </template>
        <span class="infoContent">{{stuInfo.classname}}</span>
      </el-descriptions-item>
      <el-descriptions-item>
        <template #label>
          <div class="titleCon">
            <svg t="1632273534093" class="icon" viewBox="0 0 1123 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1799" width="20" height="20"><path d="M58.235871 98.568258C26.095484 98.568258 0 124.729806 0 157.068387v798.620903c0 32.206452 26.095484 58.500129 58.235871 58.500129h1006.625032c32.140387 0 58.235871-26.161548 58.235871-58.500129V157.068387a58.467097 58.467097 0 0 0-58.235871-58.500129h-212.859871l38.746839 38.978065V40.002065c0-21.537032-17.341935-38.978065-38.746839-38.978065-21.371871 0-38.713806 17.441032-38.713806 38.978065v136.456258h251.573677a19.257806 19.257806 0 0 1-19.224774-19.422968v798.620903c0-10.768516 8.654452-19.422968 19.224774-19.422968H58.235871c10.669419 0 19.224774 8.621419 19.224774 19.422968V157.068387a19.323871 19.323871 0 0 1-19.224774 19.422968h212.859871c21.371871 0 38.713806-17.441032 38.713806-38.978065 0-21.504-17.341935-38.978065-38.713806-38.978064H58.235871z m174.113032 38.978065c0 21.470968 17.341935 38.945032 38.746839 38.945032 21.371871 0 38.713806-17.441032 38.713806-38.978065V40.035097c0-21.537032-17.341935-38.978065-38.713806-38.978065-21.404903 0-38.746839 17.441032-38.746839 38.978065v97.478193zM1123.096774 332.304516v-38.978064H0v136.390193c0 21.504 17.341935 38.978065 38.713806 38.978065 21.404903 0 38.746839-17.474065 38.746839-38.978065V332.304516l-38.746839 38.978065h1045.669162l-38.746839-38.978065v97.412129c0 21.504 17.341935 38.978065 38.746839 38.978065 21.371871 0 38.713806-17.474065 38.713806-38.978065V332.304516z m-270.963613 253.159226c21.371871 0 38.713806-17.441032 38.713807-38.978065 0-21.470968-17.341935-38.945032-38.713807-38.945032H271.095742c-21.404903 0-38.746839 17.441032-38.746839 38.978065 0 21.504 17.341935 38.978065 38.746839 38.978064h581.037419z m-581.037419 116.934193c-21.404903 0-38.746839 17.408-38.746839 38.945033 0 21.504 17.341935 38.978065 38.746839 38.978064h387.402323c21.371871 0 38.713806-17.474065 38.713806-38.978064 0-21.537032-17.341935-38.978065-38.713806-38.978065H271.095742zM852.001032 176.458323l-38.713806-38.978065v78.022194c0 21.504 17.341935 38.978065 38.713806 38.978064 21.404903 0 38.746839-17.474065 38.746839-38.978064V98.535226H271.095742c-21.404903 0-38.746839 17.474065-38.746839 38.978064 0 21.537032 17.341935 38.978065 38.746839 38.978065h580.90529zM309.842581 137.51329c0-21.504-17.341935-38.978065-38.713807-38.978064-21.404903 0-38.746839 17.474065-38.746839 38.978064v78.022194c0 21.504 17.341935 38.978065 38.746839 38.978064 21.371871 0 38.713806-17.474065 38.713807-38.978064V137.51329z" p-id="1800" fill="#909399"></path></svg>&nbsp;&nbsp;
            <span>入学年份</span>
          </div>
        </template>
        <span class="infoContent">{{`${enroDate.year} 年 ${enroDate.month} 月 ${enroDate.day} 日`}}</span>
      </el-descriptions-item>
      <el-descriptions-item >
        <template #label>
          <div class="titleCon">
            <svg t="1631923434169" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6011" width="20" height="20"><path d="M913.5 934.3H108.1c-24.7 0-44.7-20-44.7-44.7V207c0-24.7 20-44.7 44.7-44.7h805.4c24.7 0 44.7 20 44.7 44.7v682.6c0 24.7-20 44.7-44.7 44.7z m-760.7-89.5h715.9V251.7H152.8v593.1z" p-id="6012" fill="#909399"></path><path d="M322.4 317.1c-24.7 0-44.7-20-44.7-44.7V141.6c0-24.7 20-44.7 44.7-44.7s44.7 20 44.7 44.7v130.7c0 24.7-20 44.8-44.7 44.8z m376.8 0c-24.7 0-44.7-20-44.7-44.7V141.6c0-24.7 20-44.7 44.7-44.7s44.7 20 44.7 44.7v130.7c0 24.7-20 44.8-44.7 44.8zM477.9 764.5H322.4c-24.7 0-44.7-20-44.7-44.7V569.4c0-24.7 20-44.7 44.7-44.7h110.8v-60.9H322.4c-24.7 0-44.7-20-44.7-44.7 0-24.7 20-44.7 44.7-44.7h155.5c24.7 0 44.7 20 44.7 44.7v150.4c0 24.7-20 44.7-44.7 44.7H367.1V675h110.8c24.7 0 44.7 20 44.7 44.7s-20 44.8-44.7 44.8z m221.3 0c-24.7 0-44.7-20-44.7-44.7v-256H621c-24.7 0-44.7-20-44.7-44.7 0-24.7 20-44.7 44.7-44.7h78.2c24.7 0 44.7 20 44.7 44.7v300.8c0 24.6-20 44.6-44.7 44.6z" p-id="6013" fill="#909399"></path></svg>
            &nbsp;&nbsp;<span>生日</span>
          </div>
        </template>
        <el-date-picker
          size="small"
          v-model="InfoTemp.birthday"
          value-format="YYYY-MM-DD"
          format="YYYY-MM-DD"
        ></el-date-picker>
      </el-descriptions-item>
      <el-descriptions-item :span="2">
        <template #label>
          <div class="titleCon">
            <svg t="1631923480144" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6927" width="20" height="20"><path d="M679.247959 1023.824H344.517041A207.851949 207.851949 0 0 1 129.320093 824.766049V199.162201A207.851949 207.851949 0 0 1 344.517041 0.14025h334.730918a207.815949 207.815949 0 0 1 215.196948 199.022951V824.730049a207.815949 207.815949 0 0 1-215.196948 199.093951zM344.517041 85.454229a116.885971 116.885971 0 0 0-119.533971 113.743972v625.567848a116.885971 116.885971 0 0 0 119.533971 113.742972h334.730918a116.885971 116.885971 0 0 0 119.533971-113.742972V199.162201A116.885971 116.885971 0 0 0 679.247959 85.420229z" p-id="6928" fill="#909399"></path><path d="M440.144018 791.148057a71.719982 71.719982 0 1 0 71.719982-71.719983 71.719982 71.719982 0 0 0-71.719982 71.719983z" p-id="6929" fill="#909399"></path></svg>
            &nbsp;&nbsp;<span>手机号</span>
          </div>
        </template>
        <el-input
          type="text"
          placeholder="请输入你的手机号码"
          size="small"
          v-model="InfoTemp.mobile"
          :input-style="mobileCorrect ? {
          } : {
            borderColor: 'red'
          }"
          oninput ="value=value.replace(/[^\d]/g,'')"
          class="myInput"
        ></el-input>
      </el-descriptions-item>
      <el-descriptions-item :span="4">
        <template #label>
          <div class="titleCon">
            <svg t="1631923549071" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8862" width="20" height="20"><path d="M750.592 275.968c-10.24 0-20.992 1.024-31.232 2.56-48.128 8.192-90.112 34.816-118.272 74.752-58.368 82.432-38.4 197.12 44.032 254.976l7.168 5.12-7.68 4.096c-79.872 40.448-129.536 166.912-129.536 256.512 0 73.728 118.784 66.048 236.032 66.048 117.248 0 236.032 7.68 236.032-66.048 0-89.6-49.664-216.576-129.536-256.512l-7.68-3.584 7.168-5.12c16.896-12.288 31.744-26.624 44.032-44.032 28.16-39.936 39.424-88.576 30.72-136.704-8.192-48.128-34.816-90.112-74.752-118.272-32.256-22.016-68.608-33.792-106.496-33.792z m0 614.4c-92.672 0-185.856 26.624-185.856-16.384 0-102.4 83.456-231.936 185.856-231.936s185.856 129.536 185.856 231.936c0 43.52-93.696 16.384-185.856 16.384zM183.296 360.448v452.608c0 13.824 11.264 25.088 25.088 25.088h241.152c6.656 0 12.8-2.56 17.92-7.168 4.608-4.608 7.168-10.752 7.168-17.92 0-6.656-2.56-12.8-7.168-17.92-4.608-4.608-10.752-7.168-17.408-7.168H233.472V325.12l246.784-174.08 119.808 83.968c10.752 7.168 25.6 4.608 33.28-6.144 4.096-5.12 5.632-11.776 4.608-18.432s-4.096-12.288-9.728-16.384l-148.48-103.936L46.08 396.288c-5.632 4.096-9.216 9.728-10.24 16.384-1.024 6.656 0.512 13.312 4.096 18.432 8.192 11.264 23.552 13.824 34.816 6.144l108.544-76.8z m567.296 231.936c-73.216 0-133.12-59.904-133.12-133.12s59.904-133.12 133.12-133.12 133.12 59.904 133.12 133.12-59.904 133.12-133.12 133.12z" p-id="8863" fill="#909399"></path></svg>
            &nbsp;&nbsp;<span>籍贯</span>
          </div>
        </template>
        <el-row class="selectPos">
          <el-col :span="8" class="selectPosItem"><span>省：</span><el-select
            placeholder="请选择省份"
            popper-class="mySelect"
            :popper-append-to-body="false"
            size="small"
            v-model="Prov"
          >
            <el-option v-for="it in fullCityPack.pack" :key="it" :value="it.value" :label="it.label"></el-option>
          </el-select></el-col>
          <el-col :span="8" class="selectPosItem"><span>市：</span><el-select
            placeholder="请选择城市"
            popper-class="mySelect"
            :popper-append-to-body="false"
            size="small"
            :disabled="isDirect"
            v-model="City"
          >
            <el-option v-for="it in CityList" :key="it" :value="it.value" :label="it.label"></el-option>
          </el-select></el-col>
          <el-col :span="8" class="selectPosItem"><span>县/区：</span><el-select
            placeholder="请选择县/区"
            popper-class="mySelect"
            :popper-append-to-body="false"
            size="small"
            v-model="County"
          >
            <el-option v-for="it in CountyList" :key="it" :value="it.value" :label="it.label"></el-option>
          </el-select></el-col>
        </el-row>
        <el-input
          class="myInput"
          type="text"
          size="small"
          v-model="DetailPos"
        >
          <template #prepend>
            <span>详细地址：</span>
          </template>
        </el-input>
      </el-descriptions-item>
    </el-descriptions>
  </el-container>
</template>

<script lang="ts">
import { reactive, computed, ref, watch } from 'vue'
import loadingCities from '@/assets/PublicFunction/AxiosFunctions/studentInfo/loadingCities'
import locatInterface from '@/assets/PublicInterface/ComponentInterfaces/studentPage/studentInfo/locatInterface'
import { ElMessage } from 'element-plus/lib'
export default {
  name: 'stuInfoModify',
  props: {
    stuInfo: Object,
    account: String
  },
  emits: ['stuInfoModify'],
  setup (props: any, content :any) {
    const InfoTemp = reactive({
      ...props.stuInfo
    })
    const enroDate = computed(() => {
      const enroArray = InfoTemp.enro_year.split('T')[0].split('-')
      return {
        year: enroArray[0],
        month: enroArray[1],
        day: enroArray[2]
      }
    })
    const fullCityPack = reactive({
      pack: [],
      success: false
    })
    const dirCities = ['北京市', '上海市', '重庆市', '天津市']
    const natnmArray = props.stuInfo.natnm.split('-')
    const Prov = ref(natnmArray[0])
    const isDirect = computed(() => {
      var V = false
      dirCities.forEach((v: any) => {
        if (v === Prov.value) {
          V = true
        }
      })
      return V
    })
    const City = ref('')
    const County = ref('')
    const DetailPos = ref('')
    const AfterInitial = ref(false)
    setTimeout(() => {
      City.value = isDirect.value ? '市辖区' : natnmArray.length > 1 ? natnmArray[1] : ''
      County.value = isDirect.value ? natnmArray.length > 1 ? natnmArray[1] : '' : natnmArray.length > 2 ? natnmArray[2] : ''
      DetailPos.value = isDirect.value ? natnmArray.length > 2 ? natnmArray[2] : '' : natnmArray.length > 3 ? natnmArray[3] : ''
      setTimeout(() => {
        AfterInitial.value = true
      }, 100)
    }, 200)
    const FullPath = computed(() => {
      var Val = ''
      var flag = false
      if (Prov.value !== '' && Prov.value) {
        Val += Prov.value
        flag = true
      }
      if (City.value && City.value !== '' && City.value !== '市辖区') {
        if (flag) Val += '-'
        Val += City.value
        flag = true
      }
      if (County.value && County.value !== '') {
        if (flag) Val += '-'
        Val += County.value
        flag = true
      }
      if (DetailPos.value && DetailPos.value !== '') {
        if (flag) Val += '-'
        Val += DetailPos.value
      }
      return Val
    })
    const CityList = computed(() => {
      var array = new Array<locatInterface>()
      if (fullCityPack.success) {
        fullCityPack.pack.forEach((v: any) => {
          if (v.value === Prov.value) {
            array = v.children
            if (array.length === 1 && array[0].value === '市辖区') {
              City.value = array[0].value
            }
          }
        })
      }
      return array
    })
    const CountyList = computed(() => {
      var array = new Array<locatInterface>()
      if (fullCityPack.success) {
        CityList.value.forEach((v: any) => {
          if (v.value === City.value) {
            array = v.children
          }
        })
      }
      return array
    })
    watch(Prov, () => {
      if (AfterInitial.value) {
        City.value = ''
        County.value = ''
        DetailPos.value = ''
      }
    })
    watch(City, () => {
      if (AfterInitial.value) {
        County.value = ''
        DetailPos.value = ''
      }
    })
    watch(County, () => {
      if (AfterInitial.value) {
        DetailPos.value = ''
      }
    })
    watch(FullPath, () => {
      InfoTemp.natnm = FullPath.value
    })
    function getFullPack (resp: any) {
      fullCityPack.pack = resp.data
      fullCityPack.success = true
    }
    function packGetError (resp: any) {
      console.log(resp)
    }
    loadingCities(getFullPack, packGetError)
    const Mods = computed(() => {
      var Val = 0
      const arrayCurr = Object.values(InfoTemp)
      const arrayPrime = Object.values(props.stuInfo)
      arrayPrime.forEach((v: any, index: number) => {
        if (v !== arrayCurr[index]) {
          Val++
        }
      })
      return Val
    })
    const mobileCorrect = computed(() => InfoTemp.mobile.length === 11)
    function setModify () {
      if (mobileCorrect.value) {
        content.emit('stuInfoModify', InfoTemp)
      } else {
        ElMessage.error('请检查表单信息！')
      }
    }
    function Discard () {
      InfoTemp.sex = props.stuInfo.sex
      InfoTemp.birthday = props.stuInfo.birthday
      InfoTemp.mobile = props.stuInfo.mobile
      InfoTemp.natnm = props.stuInfo.natnm
    }
    return {
      InfoTemp, enroDate, Mods, fullCityPack, CityList, CountyList, Prov, City, County, DetailPos, isDirect, Discard, setModify, mobileCorrect
    }
  }
}
</script>

<style lang="scss" scoped>
  @import "../../../assets/Fonts/FontMap/FontMap";
  @import "../../../assets/Fonts/FontMap/FontList.css";
  .stuInfoModifyMain{
    padding: 10px;
  }
  .stuInfo{
    font-size: 20px;
    font-family: $SH_Serif_Regular;
    color: #909399;
  }
  .titleCon{
    display: flex;
    align-items: center;
    span{
      line-height: 0;
    }
  }
  .infoSheet{
    font-family: $Mi_Lan;
  }
  .infoContent{
    font-family: $SH_Serif_Regular;
  }
  .mySelect{
    font-family: $SH_Serif_Regular;
    *{
      font-family: $SH_Serif_Regular;
    }
  }
  .myInput{
    font-family: $SH_Serif_Regular;
  }
  .selectPos{
    display: flex;
    align-items: center;
    width: 100%;
    height: fit-content;
    position: relative;
    font-family: $SH_Serif_Regular;
    margin-bottom: 13px;
    .selectPosItem:nth-child(-n + 2) {
      padding-right: 10px;
    }
    .selectPosItem{
      display: flex;
      align-items: center;
      span{
        line-height: 0;
        display: flex;
        align-items: center;
        white-space: nowrap;
      };
    }
  }
  .InfoModBadge{
    font-family: $SH_Serif_Regular;
  }
</style>
